<?php 

echo "****初始化session**********";
echo "<br/>";
//1.初始化session
session_start();

//2.保存数据
$_SESSION['name']="lidefu";
$_SESSION['age']=100;
$_SESSION['isboy']=true;
$arr=array("a","b","c");
$_SESSION['arr']=$arr;
class Dog{
    private $name;
    private $age;
    function __construct($name,$age){
        $this->name=$name;
        $this->age=$age;
    }
    public function getName(){
        return $this->name;
    }
}
$dog=new Dog("xiao dog",12);
echo "<br/>";
$_SESSION['dog']=$dog;
echo "保存成功";



?>